package com.suzhe.ymall.order.client;

import com.suzhe.ymall.common.pojo.ApiResEntity;
import com.suzhe.ymall.product.param.LockStockParam;
import com.suzhe.ymall.product.vo.SkuVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "product-service",fallback  = ProductClientFallBack.class )//
public interface ProductClient {
    /**
     * 根据sku ids查询sku
     * @param ids
     * @return
     */
    @GetMapping("product/querySkuVosByIds")
    List<SkuVo> querySkuVosByIds(@RequestParam("ids") List<Integer> ids);

    @PostMapping("product/lockStock")
    ApiResEntity lockStock(@RequestBody LockStockParam lockStockParam);
}
